package com.clive.ttwebdemo.vo;

import com.clive.ttwebdemo.bean.DishesCategory;
import com.clive.ttwebdemo.constant.DishConstant;


import java.awt.font.TextHitInfo;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class DishResult {
    private Boolean success;
    private Integer code;
    private String message;
    private Map<String,Object> date = new HashMap<String, Object>();

    public static DishResult ok(){
        DishResult result = new DishResult();
        result.setSuccess(true);
        result.setCode(DishConstant.SUCCESS);
        result.setMessage("成功");
        return result;
    }
    public static DishResult error(String message){
        DishResult result = new DishResult();
        result.setSuccess(false);
        result.setCode(DishConstant. ERROR);
        result.setMessage(message);
        return result;
    }
    public DishResult date(String key, Object value){
        this.date.put(key,value);
        return this;
    }
    public DishResult date(Map<String,Object> map){
        this.setDate(map);
        return this;
    }

    public Boolean getSuccess() {
        return success;
    }

    public void setSuccess(Boolean success) {
        this.success = success;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Map<String, Object> getDate() {
        return date;
    }

    public void setDate(Map<String, Object> date) {
        this.date = date;
    }

    @Override
    public String toString() {
        return "DishResult{" +
                "success=" + success +
                ", code=" + code +
                ", message='" + message + '\'' +
                ", date=" + date +
                '}';
    }
}
